﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Win32;
using ISUM_V2;
namespace AutoCompleteText
{
    class FileProcess
    {
        public FileProcess()
        {
        }

             

        public string OpenDocument(MainWindow window)
        {
            //if(MainWindow.vmLife!=true)
            //{
            //    MainWindow.vm = new VirtualMouse(window);
            //    MainWindow.vmLife = true;
            //}
            //MainWindow.vm.Show();
            //MainWindow.change = "Mouse";
            // 파일 열기 다이얼로그 박스를 설정
            OpenFileDialog dlg = new OpenFileDialog();
            dlg.FileName = "input"; // Default file name
            dlg.DefaultExt = ".txt"; // Default file extension
            dlg.Filter = "Text documents (.txt)|*.txt|Word document(.doc)|*.doc|Excel document(.xls)|*.xls|PowerPoint document(.ppt)|*.ppt|All file(*.*)|*.*"; // Filter files by extension

            // Show open file dialog box
            Nullable<bool> result = dlg.ShowDialog();

            // Process open file dialog box results
            if (result == true)
            {
                // Open document
                string filename = dlg.FileName;
                return filename;
            }else
            {
                return null;
            }
            

        }

    }
}
